//------------------------------------------------------------------------------
// Fichiers d'entete utilises
//------------------------------------------------------------------------------
#include "SegmentContainer.hpp"

//------------------------------------------------------------------------------
// Définition de constantes
//------------------------------------------------------------------------------
namespace ImageAnalysis
{
	//----------------------------------------------------------------------
	// Constructeur
	//----------------------------------------------------------------------
	SegmentContainer::SegmentContainer( int width, int height ):
	imageWidth( width ),
	imageHeight( height )
	{

	}

	//----------------------------------------------------------------------
	// Destructeur
	//----------------------------------------------------------------------
	SegmentContainer::~SegmentContainer( )
	{
		TSegmentContainerIterator iterator;
		for( iterator = segmentList.begin(); iterator != segmentList.end(); ++iterator )
		{	
			delete *iterator;
		}
		segmentList.clear();
	}
	
	
	//----------------------------------------------------------------------
	// 
	//----------------------------------------------------------------------
	int SegmentContainer::GetNumberOfSegments( )
	{
		return segmentList.size();
	}



	//----------------------------------------------------------------------
	// 
	//----------------------------------------------------------------------
	void SegmentContainer::AddSegment( Segment* segment)
	{
		segmentList.push_back( segment );
	}

	//----------------------------------------------------------------------
	// Méthode 
	//----------------------------------------------------------------------
	SegmentContainer::TSegmentContainerIterator SegmentContainer::GetStartSegment( )
	{
		return segmentList.begin();
	}

	//----------------------------------------------------------------------
	// 
	//----------------------------------------------------------------------
	SegmentContainer::TSegmentContainerIterator SegmentContainer::GetEndSegment( )
	{
		return segmentList.end();
	}
}

